Skip to content

zveriu/CVE-2009-0229-PoC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

CVE-2009-0229-PoC

PoC for CVE-2009-0229 "Print Spooler Read File Vulnerability" LPE AFR (related to CVE-2020-1048)

Details

  • Author: Andrei Costin (zveriu@gmail.com)
  • PoC date: 2010-xx-xx
  • Release date: 2020-05-14 (reminded/inspired by CVE-2020-1048 - yes, I am too late to the party :D )
  • TL;DR
    • If you want 0days, dig Printing and Faxing sub-system of OSes :) - lots of legacy code due to historical reasons - there are vulns for everyone =)

Notes

  • Note1: Unverified - unsure 100% is the same bug that triggers the CVE-2009-0229

  • Note2: Unverified - could work on newer systems like Windows Server 2012 and Windows Server 2016

  • Note3: All Windows releases come with 4 default "Separator Page" files

    • pcl.sep
    • pscript.sep
    • sysprint.sep
    • sysprtj.sep
  • Note4: This trick is older than Windows 95 =), pretty sure it was used by pros for "stealth info recovery" ;)

Pre-requisites

  • (non-admin) local attacker has "printer management rights"
    • option1: can add a new printer
    • option2: can modify settings of an existing "system wide" printer (many times the case)
  • "arbitrary file" for exfiltration does not have explicit "Deny Read" permission
    • highly unlikely as that would make accessing files for the victim really unpractical/unusable

PoC Execution

  • Local attacker configures any printer s/he has access to so that it uses "Separator Page" file supplied by the attacker (attack.sep), now attacker has "weaponized printer"

    • See "Windows "Separator Page" References" below for details
  • Local attacker crafts the "Separator Page" file (attack.sep) to use the "@F"/"$F" operator, as follows, where the file to be exfiltrated is assumed to be "C:\secret.txt" (notice the \ and the direct concatenation to @F operator)

@
@FC:\\secret.txt
  • Local attacker needs to print something using the "weaponized" printer above

    • For example, local attacker opens Notepad, prints the empty document through the printer configured above with "Separator Page" file
    • Local attacker uses the "print to file" (e.g., c:\temp\exfiltrated.out) option when printing - there are "print to file" .ps in most Windows versions + .xps in newer ones (http://ps-2.kev009.com/pcpartnerinfo/ctstips/e94a.htm)
      • This is done so that the content of the exfiltrated file does not go to the printer (though this is also an option), but becomes immediately available to the attacker
  • Attack improvement: one "Separator Page" file can have a brute-force list of most common filepaths/filenames

  • There is also @L operator :)

Trivia

Security References

Windows "Separator Page" References

About

PoC for CVE-2009-0229 "Print Spooler Read File Vulnerability" LPE AFR (related to CVE-2020-1048)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published